<?php

declare (strict_types=1);

namespace app\api\controller;

use app\api\service\Protocol as ProtocolService;
use think\App;
use think\response\Json;


/**
 * 用户协议类
 * Class Goods
 * @package app\api\controller
 */
class Protocol extends Controller
{

    private $protocolService;
   public function __construct(App $app,ProtocolService $protocolService)
   {
       parent::__construct($app);
       $this->protocolService = $protocolService;

   }

    //协议
    public function detail():Json
    {
        $params = $this->request->get();
        $this->validate(
            $params,
            [
                'key' => 'require'
            ]
        );
        $key = $params['key'];
        $res = $this->protocolService->getDetail($key);
        return $this->renderSuccess($res);
    }




}
